﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true"
    CodeBehind="ClienteDirecciones.aspx.cs" Inherits="Emporium_Web.ClienteDirecciones"
    Theme="Constellation" %>

<%@ MasterType VirtualPath="~/Menu.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Direcciones</title>
    <script type="text/javascript">
        var hdnSeleccionId = '<%= this.hdnSeleccion.ClientID %>';
    </script>
    <script type="text/javascript" src="js/funciones.grid.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- Content -->
    <article class="container_12">
	  
		<section class="grid_12">
			<div class="block-border">
			<form runat="server" class="block-content form" id="table_form">
				<h1>Direcciones</h1>

                <div style="width: 100%; padding-top: 20px;">
                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 100px; float: left;">
                            <label>
                                Cliente
                            </label>
                        </div>
                        <div align="left" style="width: 70%; float: left;">
                            <asp:TextBox ID="txtNombre" runat="server" Width="300px" Enabled="false"></asp:TextBox>&nbsp;
                        </div>
                    </div>
                </div>

                    <asp:HiddenField ID="hdnSeleccion" runat="server" />
					<ul class="message error no-margin" runat="server" id="errorMessage">
					    <li><asp:Label runat="server" ID="lblErrorMessage"></asp:Label></li>
					</ul>
                    <ul class="message warning no-margin" runat="server"  id="warningMessage">
					    <li><asp:Label runat="server" ID="lblWarningMessage"></asp:Label></li>
					</ul>
                      <div class="block-controls"></div>
                    <div class="no-margin">
					<asp:GridView ID="gvDirecciones" runat="server" Width="100%" SkinID="gridviewSkin" ShowHeaderWhenEmpty="false" PageSize="5" onrowcommand="gvDirecciones_RowCommand">
                        
                        <Columns>                   
							<asp:TemplateField>
								<HeaderTemplate>
									
								</HeaderTemplate>
								<ItemTemplate>
                                      <input id="rbSelect" type="radio" name="selectGroup" value="rbSelect" onclick="javascript:Check('<%# Eval("Id") %>');"/>
								</ItemTemplate>
								<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								<ItemStyle HorizontalAlign="Left" Width="8%" />
							</asp:TemplateField>
                            <asp:TemplateField HeaderText="Sec">
                            <HeaderStyle Width="70px" />
                                <FooterTemplate>
                                    <asp:TextBox ID="txtSec" runat="server"> 
                                    </asp:TextBox><asp:RequiredFieldValidator ID="reqSec" runat="server" ControlToValidate="txtSec" ErrorMessage="Este campo es obligatorio">
                                    </asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="regSec" runat="server" ControlToValidate="txtSec"  ValidationExpression="^\d+$" ErrorMessage="Ingrese solo números"></asp:RegularExpressionValidator>
                                </FooterTemplate>
                                <ItemTemplate> 
                                    <asp:Label ID="lblSec" runat="server" Text='<%# Bind("Sec") %>'></asp:Label> 
                                </ItemTemplate>
							</asp:TemplateField>
                            <asp:TemplateField HeaderText="Dirección">
                            <HeaderStyle Width="300px" />
                                <FooterTemplate>
                                    <asp:TextBox ID="txtDescripcion" runat="server" Width="270px"></asp:TextBox> 
                                    <asp:RequiredFieldValidator ID="reqDireccion" runat="server" ControlToValidate="txtDescripcion" ErrorMessage="Este campo es obligatorio"></asp:RequiredFieldValidator>
                                </FooterTemplate>
                                <ItemTemplate> 
                                    <asp:Label ID="lblDescripcion" runat="server" Text='<%# Bind("Descripcion") %>'></asp:Label> 
                                </ItemTemplate>
							</asp:TemplateField>
                            <asp:TemplateField HeaderText="País">
                                <FooterTemplate>
                                    <asp:DropDownList ID="ddlPais" DataValueField="Id" DataTextField="Descripcion" runat="server"></asp:DropDownList>
                                </FooterTemplate>
                                <ItemTemplate> 
                                    <asp:Label ID="lblPais" runat="server" Text='<%# Bind("Pais") %>'></asp:Label> 
                                </ItemTemplate>
							</asp:TemplateField>
                            <asp:TemplateField HeaderText="Referencia">
                                <FooterTemplate>
                                    <asp:TextBox ID="txtReferencia" runat="server"> </asp:TextBox> 
                                </FooterTemplate>
                                <ItemTemplate> 
                                    <asp:Label ID="lblReferencia" runat="server" Text='<%# Bind("Referencia") %>'></asp:Label> 
                                </ItemTemplate>
							</asp:TemplateField>
							 <asp:TemplateField>
                                <FooterTemplate>
                                    <asp:LinkButton ID="lnkGrabar" runat="server" CommandName="Insert" Text="Adicionar"></asp:LinkButton> 
                                </FooterTemplate>
                                <ItemTemplate> 
                                   
                                </ItemTemplate>
							</asp:TemplateField>
						</Columns>  
						<PagerSettings Visible="false" />
					</asp:GridView> 
                    </div>
                 <ul class="message no-margin">
                    <li>
                        <asp:Label ID="lblMensajeGridFooter" runat="server"></asp:Label>
                    </li>
				</ul>
				<div class="block-footer">
                    <img src="images/icons/fugue/arrow-curve-000-left.png" width="16" height="16" class="picto"> 
					<asp:LinkButton ID="btnEliminar" runat="server" Text="Eliminar" CssClass="button" onclick="btnEliminar_Click" OnClientClick="return DeleteRegs();" CausesValidation="false"/>
					<asp:LinkButton ID="btnAtras" runat="server" Text="Atrás" CssClass="button" onclick="btnAtras_Click" CausesValidation="false"/>
				</div>
				
				
			</form>
			</div>
		</section>
	</article>
</asp:Content>
